{% extends "base.html" %}

{% block title %}Multipay{% endblock %}
{% block heading %}Multipay{% endblock %}

{% block leftmenu %}
	<a href='/listops'>Ops List</a><br/>
	<a href='/stats'>Stats</a><br/>
{% endblock %}

{% block content %}
	<h2>Unpaid ops</h2>
	<table>
		<tr class="standard">
			<th align='left'>Name</th>
			<th align='left'>Type</th>
			<th align='right'>Pilots</th>
			<th align='right'>ISK</th>
			<th>&nbsp;</th>
			<th align='right'>Strat</th>
			<th align='right'>Corp</th>
			<th align='right'>FC</th>
		</tr>
		{% for op in unpaid %}
		<tr class="{% cycle odd,even%}">
			<td>{{op.name}}</td>
			<td>{{op.op_type}}</td>
			<td align='right'>{{op.pilots|length}}</td>
			<td align='right'>{{op.op_isk_000}}</td>
			<td><a href='/payop?id={{op.key.id}}'>[Pay]</a></td>
			<td align='right'>{{op.pay_strategy}}</td>
			<td align='right'>{{op.corp_tax}}%</td>
			<td align='right'>{{op.fc_payout}}%</td>
		</tr>
		{% endfor %}
		<tr>
			<td align='left'>Total:</th>
			<td align='right'>&nbsp;</th>	
			<td align='right'>&nbsp;</th>	
			<td align='right'><b>{{total_isk}}</b></th>
			<td align='right'>&nbsp;</th>	
			<td align='right'>&nbsp;</th>	
			<td align='right'>&nbsp;</th>	
			<td align='right'>&nbsp;</th>	
		</tr>
	</table>

	<form action='/multipaid' method='post'>
		<input type='hidden' name='op_ids' value='{{op_ids}}' />
		<input type='submit' value="Mark paid"/>
		<p><i>Will mark all ops in the above list as paid if the isk value is greater than 0</i></p>
	</form>

	<h2>Payouts</h2>
	<table>
		<tr class="standard">
			<th align='left'>Pilot</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
			<th>&nbsp;</th>
		</tr>
	{% for p_i in pilot_isk %}
		 <tr class="{% cycle odd,even%}">
			<a id='{{forloop.counter}}' name='{{forloop.counter}}' />
			<td>
				{% ifequal p_i.pilot.char_id "-1" %}
					{{ p_i.pilot.char_name }}
				{% else %}
					<a href='#{{forloop.counter}}' onClick="CCPEVE.showInfo(1377, {{p_i.pilot.char_id}})">{{ p_i.pilot.char_name }}</a>
				{% endifequal %}
			</td>
			<td align='right'>{{p_i.ops}}</td>
			<td align='right'>{{p_i.isk_000}}</td>
			<td><input type='checkbox' /></td>
		</tr>
	{% endfor %}
		<tr>
			<td align='left'><b>Corp</b></th>
			<td align='right'>&nbsp;</th>	
			<td align='right'><b>{{corp_isk}}</b></th>
		</tr>
	</table>

{% endblock %}
